package com.ly.mp.cmc.common.exception;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author: ly-songpengfei
 * @Date: 2025/8/3 21:25
 * @Description: 系统异常处理类
 * @Version:
 */
@Data
public class SystemException extends RuntimeException implements Serializable {

    // 异常编码
    private String code;
    // 异常信息
    private String message;

    public SystemException(ExceptionEnum exceptionEnum){
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    public SystemException(String message) {
        super(message);
    }

    public SystemException(String message, Throwable cause) {
        super(message, cause);
    }

    public SystemException(Throwable cause) {
        super(cause);
    }
}
